package com.qc.toutiao.services.Ipml;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.session.SqlSession;

import com.qc.toutiao.dao.NewMapper;
import com.qc.toutiao.services.NewsService;
import com.qc.toutiao.util.SessionUtil;

public class NewsServiceImpl implements NewsService{
	
	NewMapper newMapper;
	SqlSession session;
	SessionUtil sessionUtil = new SessionUtil();
	
	

	public NewsServiceImpl() {
		session = sessionUtil.getSession();
		newMapper = session.getMapper(NewMapper.class);
	}

	@Override
	public List<Map<String, Object>> findPageAll(Integer indexPage, Integer pageSize) {
		
		List<Map<String, Object>> newList = newMapper.findPageAll(((indexPage-1) * pageSize), pageSize);
		sessionUtil.close(session);
		
		
		return newList;
	}

	
	
	
	
}
